///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "PreviewWindow.h"

#include "Layout.h"

///////////////////////////////////////////////////////////////////////////

MainFrm::MainFrm( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	mStatusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, ID_STATUS_BAR );
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxVERTICAL );
	
	mTabbedProjectContainer = new wxAuiNotebook( this, ID_TABBED_PROJECT_CONTAINER, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_DEFAULT_STYLE|wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_WINDOWLIST_BUTTON );
	
	bSizer1->Add( mTabbedProjectContainer, 1, wxEXPAND | wxALL, 0 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	mMenuBar = new wxMenuBar( 0 );
	mFileMenu = new wxMenu();
	wxMenuItem* mNewProject;
	mNewProject = new wxMenuItem( mFileMenu, ID_NEW_PROJECT, wxString( wxT("New &Project") ) , wxT("Create a new project"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	mNewProject->SetBitmaps( wxBitmap( wxT("images/icon_new_project.png"), wxBITMAP_TYPE_ANY ) );
	#elif defined( __WXGTK__ )
	mNewProject->SetBitmap( wxBitmap( wxT("images/icon_new_project.png"), wxBITMAP_TYPE_ANY ) );
	#endif
	mFileMenu->Append( mNewProject );
	
	wxMenuItem* mNewFontset;
	mNewFontset = new wxMenuItem( mFileMenu, ID_NEW_FONTSET, wxString( wxT("New &Fontset") ) , wxT("Add a new fontset to the project"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	mNewFontset->SetBitmaps( wxBitmap( wxT("images/icon_new_fontset.png"), wxBITMAP_TYPE_ANY ) );
	#elif defined( __WXGTK__ )
	mNewFontset->SetBitmap( wxBitmap( wxT("images/icon_new_fontset.png"), wxBITMAP_TYPE_ANY ) );
	#endif
	mFileMenu->Append( mNewFontset );
	
	mFileMenu->AppendSeparator();
	
	wxMenuItem* mFileOpen;
	mFileOpen = new wxMenuItem( mFileMenu, ID_FILE_OPEN, wxString( wxT("&Open...") ) + wxT('\t') + wxT("CTRL+O"), wxT("Load a project file"), wxITEM_NORMAL );
	#ifdef __WXMSW__
	mFileOpen->SetBitmaps( wxBitmap( wxT("images/icon_open_file.png"), wxBITMAP_TYPE_ANY ) );
	#elif defined( __WXGTK__ )
	mFileOpen->SetBitmap( wxBitmap( wxT("images/icon_open_file.png"), wxBITMAP_TYPE_ANY ) );
	#endif
	mFileMenu->Append( mFileOpen );
	
	wxMenuItem* mFileSave;
	mFileSave = new wxMenuItem( mFileMenu, ID_FILE_SAVE, wxString( wxT("&Save") ) + wxT('\t') + wxT("CTRL+S"), wxT("Save the current project"), wxITEM_NORMAL );
	mFileMenu->Append( mFileSave );
	
	wxMenuItem* mFileSaveAs;
	mFileSaveAs = new wxMenuItem( mFileMenu, ID_FILE_SAVE_AS, wxString( wxT("Save &As...") ) + wxT('\t') + wxT("SHIFT+CTRL+S"), wxT("Save the project to a new file"), wxITEM_NORMAL );
	mFileMenu->Append( mFileSaveAs );
	
	mFileMenu->AppendSeparator();
	
	m_menu3 = new wxMenu();
	wxMenuItem* mFileExportPNG;
	mFileExportPNG = new wxMenuItem( m_menu3, ID_FILE_EXPORT_PNG, wxString( wxT("&PNG") ) , wxT("Export the font settings using a PNG data file"), wxITEM_NORMAL );
	m_menu3->Append( mFileExportPNG );
	
	wxMenuItem* mFileExportFreetype;
	mFileExportFreetype = new wxMenuItem( m_menu3, ID_FILE_EXPORT_FREETYPE, wxString( wxT("Freetype") ) , wxT("Export the file settings using freetype."), wxITEM_NORMAL );
	m_menu3->Append( mFileExportFreetype );
	
	mFileMenu->Append( -1, wxT("&Export..."), m_menu3 );
	
	mFileMenu->AppendSeparator();
	
	wxMenuItem* mPreferences;
	mPreferences = new wxMenuItem( mFileMenu, ID_EDIT_PREFERENCES, wxString( wxT("Preferences...") ) , wxT("Edit the preferences"), wxITEM_NORMAL );
	mFileMenu->Append( mPreferences );
	
	mFileMenu->AppendSeparator();
	
	wxMenuItem* mFileExit;
	mFileExit = new wxMenuItem( mFileMenu, wxID_EXIT, wxString( wxT("E&xit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Exit the application"), wxITEM_NORMAL );
	mFileMenu->Append( mFileExit );
	
	mMenuBar->Append( mFileMenu, wxT("&File") );
	
	mViewMenu = new wxMenu();
	wxMenuItem* mViewGridlines;
	mViewGridlines = new wxMenuItem( mViewMenu, ID_VIEW_GRIDLINES, wxString( wxT("&Grid lines") ) , wxT("Toggle display of the grid lines"), wxITEM_CHECK );
	mViewMenu->Append( mViewGridlines );
	
	wxMenuItem* mViewWidths;
	mViewWidths = new wxMenuItem( mViewMenu, ID_VIEW_WIDTHS, wxString( wxT("&Widths") ) , wxT("Toggle display of the character widths"), wxITEM_CHECK );
	mViewMenu->Append( mViewWidths );
	
	mMenuBar->Append( mViewMenu, wxT("&View") );
	
	this->SetMenuBar( mMenuBar );
	
	mMainToolbar = this->CreateToolBar( wxTB_DOCKABLE|wxTB_FLAT|wxTB_HORIZONTAL, wxID_ANY );
	mMainToolbar->SetToolBitmapSize( wxSize( 20,20 ) );
	mMainToolbar->AddTool( wxID_NEW, wxT("New project"), wxBitmap( wxT("images/icon_new_project.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxT("Create a new project"), wxT("Create a new project") );
	mMainToolbar->AddTool( ID_NEW_FONTSET, wxT("New fontset"), wxBitmap( wxT("images/icon_new_fontset.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxT("Add a new fontset to the project"), wxT("Add a new fontset to the project") );
	mMainToolbar->AddTool( wxID_OPEN, wxT("Open file"), wxBitmap( wxT("images/icon_open_file.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxT("Load a project file"), wxT("Load a project file") );
	mMainToolbar->AddTool( wxID_SAVE, wxT("Save file"), wxBitmap( wxT("images/icon_save_project.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxT("Save the current project"), wxT("Save the current project") );
	mMainToolbar->AddSeparator();
	mMainToolbar->AddTool( wxID_ANY, wxT("View gridlines"), wxBitmap( wxT("images/icon_view_gridlines.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_CHECK, wxT("Toggle gridline display"), wxT("Toggle gridline display") );
	mMainToolbar->AddTool( wxID_ANY, wxT("View widths"), wxBitmap( wxT("images/icon_view_widths.png"), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_NORMAL, wxT("Toggle character width display"), wxT("Toggle character width display") );
	mMainToolbar->Realize();
	
	
	// Connect Events
	mTabbedProjectContainer->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( MainFrm::OnCloseTab ), NULL, this );
	mTabbedProjectContainer->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrm::OnTPCUpdateUI ), NULL, this );
	this->Connect( mNewProject->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnNewProject ) );
	this->Connect( mNewFontset->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnNewFontset ) );
	this->Connect( mFileExportPNG->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnFileExportPNG ) );
	this->Connect( mFileExportFreetype->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnFileExportFreetype ) );
	this->Connect( mPreferences->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnEditPreferences ) );
	this->Connect( mViewGridlines->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnViewGridlines ) );
	this->Connect( mViewGridlines->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrm::OnUpdateViewGridlines ) );
	this->Connect( mViewWidths->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnViewWidths ) );
	this->Connect( mViewWidths->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrm::OnUpdateViewWidths ) );
	this->Connect( ID_NEW_FONTSET, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrm::OnNewFontset ) );
	this->Connect( wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrm::OnViewGridlines ) );
	this->Connect( wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrm::OnViewWidths ) );
}

MainFrm::~MainFrm()
{
	// Disconnect Events
	mTabbedProjectContainer->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( MainFrm::OnCloseTab ), NULL, this );
	mTabbedProjectContainer->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrm::OnTPCUpdateUI ), NULL, this );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnNewProject ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnNewFontset ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnFileExportPNG ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnFileExportFreetype ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnEditPreferences ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnViewGridlines ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrm::OnUpdateViewGridlines ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrm::OnViewWidths ) );
	this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( MainFrm::OnUpdateViewWidths ) );
	this->Disconnect( ID_NEW_FONTSET, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrm::OnNewFontset ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrm::OnViewGridlines ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( MainFrm::OnViewWidths ) );
}

FontsetPanel::FontsetPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxHORIZONTAL );
	
	mPreviewWindow = new PreviewWindow( this, ID_PREVIEW_WINDOW, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
	mPreviewWindow->SetScrollRate( 5, 5 );
	bSizer3->Add( mPreviewWindow, 1, wxEXPAND | wxALL, 5 );
	
	mControlPanel = new wxScrolledWindow( this, ID_CONTROL_PANEL, wxDefaultPosition, wxSize( 320,-1 ), wxSUNKEN_BORDER|wxTAB_TRAVERSAL|wxVSCROLL );
	mControlPanel->SetScrollRate( 5, 5 );
	wxBoxSizer* bSizer8;
	bSizer8 = new wxBoxSizer( wxVERTICAL );
	
	wxFlexGridSizer* fgSizer6;
	fgSizer6 = new wxFlexGridSizer( 1, 2, 0, 0 );
	fgSizer6->SetFlexibleDirection( wxBOTH );
	fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText25 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Fontset Name:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText25->Wrap( -1 );
	fgSizer6->Add( m_staticText25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	mFontsetName = new wxTextCtrl( mControlPanel, wxID_ANY, wxT("Fontset"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
	fgSizer6->Add( mFontsetName, 0, wxALL|wxEXPAND, 5 );
	
	bSizer8->Add( fgSizer6, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer1;
	sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( mControlPanel, wxID_ANY, wxT("Font") ), wxVERTICAL );
	
	wxGridBagSizer* gbSizer6;
	gbSizer6 = new wxGridBagSizer( 0, 0 );
	gbSizer6->SetFlexibleDirection( wxBOTH );
	gbSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText2 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Font Name:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText2->Wrap( -1 );
	gbSizer6->Add( m_staticText2, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	mFontName = new wxComboBox( mControlPanel, ID_FONT_NAME, wxT("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY|wxCB_SORT ); 
	gbSizer6->Add( mFontName, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	mFontBold = new wxCheckBox( mControlPanel, wxID_ANY, wxT("Bold"), wxDefaultPosition, wxDefaultSize, 0 );
	
	bSizer5->Add( mFontBold, 0, wxALL, 5 );
	
	mFontUnderline = new wxCheckBox( mControlPanel, wxID_ANY, wxT("Underline"), wxDefaultPosition, wxDefaultSize, 0 );
	
	bSizer5->Add( mFontUnderline, 0, wxALL, 5 );
	
	mFontItalic = new wxCheckBox( mControlPanel, wxID_ANY, wxT("Italic"), wxDefaultPosition, wxDefaultSize, 0 );
	
	bSizer5->Add( mFontItalic, 0, wxALL, 5 );
	
	gbSizer6->Add( bSizer5, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
	
	m_staticText4 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Font Height:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	gbSizer6->Add( m_staticText4, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	mFontHeight = new wxSpinCtrl( mControlPanel, ID_FONT_HEIGHT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 1000, 20 );
	gbSizer6->Add( mFontHeight, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	m_staticText5 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Font Width:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText5->Wrap( -1 );
	gbSizer6->Add( m_staticText5, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	mFontWidth = new wxSpinCtrl( mControlPanel, ID_FONT_WIDTH, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 0 );
	gbSizer6->Add( mFontWidth, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	m_staticText6 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Start Character:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	gbSizer6->Add( m_staticText6, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	mStartCharacter = new wxSpinCtrl( mControlPanel, ID_START_CHARACTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 256, 32 );
	gbSizer6->Add( mStartCharacter, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	sbSizer1->Add( gbSizer6, 1, wxEXPAND, 5 );
	
	bSizer8->Add( sbSizer1, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer4;
	sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( mControlPanel, wxID_ANY, wxT("Texture") ), wxVERTICAL );
	
	wxGridBagSizer* gbSizer7;
	gbSizer7 = new wxGridBagSizer( 0, 0 );
	gbSizer7->SetFlexibleDirection( wxBOTH );
	gbSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText18 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Image Size:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText18->Wrap( -1 );
	gbSizer7->Add( m_staticText18, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	wxString mImageWidthChoices[] = { wxT("64"), wxT("128"), wxT("256"), wxT("512"), wxT("1024"), wxT("2048"), wxT("4096") };
	int mImageWidthNChoices = sizeof( mImageWidthChoices ) / sizeof( wxString );
	mImageWidth = new wxChoice( mControlPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, mImageWidthNChoices, mImageWidthChoices, 0 );
	mImageWidth->SetSelection( 2 );
	bSizer10->Add( mImageWidth, 0, wxALL, 5 );
	
	m_staticText19 = new wxStaticText( mControlPanel, wxID_ANY, wxT("x"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText19->Wrap( -1 );
	bSizer10->Add( m_staticText19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	wxString mImageHeightChoices[] = { wxT("64"), wxT("128"), wxT("256"), wxT("512"), wxT("1024"), wxT("2048"), wxT("4096") };
	int mImageHeightNChoices = sizeof( mImageHeightChoices ) / sizeof( wxString );
	mImageHeight = new wxChoice( mControlPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, mImageHeightNChoices, mImageHeightChoices, 0 );
	mImageHeight->SetSelection( 2 );
	bSizer10->Add( mImageHeight, 0, wxALL, 5 );
	
	gbSizer7->Add( bSizer10, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
	
	m_staticText20 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Cell Height:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText20->Wrap( -1 );
	gbSizer7->Add( m_staticText20, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	mCellHeight = new wxSpinCtrl( mControlPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 1000, 32 );
	gbSizer7->Add( mCellHeight, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	m_staticText22 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Cell Width:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText22->Wrap( -1 );
	gbSizer7->Add( m_staticText22, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	mCellWidth = new wxSpinCtrl( mControlPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 1000, 32 );
	gbSizer7->Add( mCellWidth, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	m_staticText23 = new wxStaticText( mControlPanel, wxID_ANY, wxT("Anti-Aliasing:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText23->Wrap( -1 );
	gbSizer7->Add( m_staticText23, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	wxString mAntiAliasModeChoices[] = { wxT("None"), wxT("Normal") };
	int mAntiAliasModeNChoices = sizeof( mAntiAliasModeChoices ) / sizeof( wxString );
	mAntiAliasMode = new wxChoice( mControlPanel, ID_ANTIALIAS_MODE, wxDefaultPosition, wxDefaultSize, mAntiAliasModeNChoices, mAntiAliasModeChoices, 0 );
	mAntiAliasMode->SetSelection( 1 );
	gbSizer7->Add( mAntiAliasMode, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
	
	sbSizer4->Add( gbSizer7, 1, wxEXPAND, 5 );
	
	bSizer8->Add( sbSizer4, 0, wxEXPAND, 5 );
	
	mControlPanel->SetSizer( bSizer8 );
	mControlPanel->Layout();
	bSizer3->Add( mControlPanel, 0, wxEXPAND | wxALL, 5 );
	
	this->SetSizer( bSizer3 );
	this->Layout();
	
	// Connect Events
	mFontsetName->Connect( wxEVT_CHAR, wxKeyEventHandler( FontsetPanel::OnCharFontsetName ), NULL, this );
	mFontsetName->Connect( wxEVT_KEY_UP, wxKeyEventHandler( FontsetPanel::OnKeyUpFontsetName ), NULL, this );
	mFontsetName->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( FontsetPanel::OnKillFocusFontsetName ), NULL, this );
	mFontsetName->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( FontsetPanel::OnFontsetNameChanged ), NULL, this );
	mFontName->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( FontsetPanel::OnFontName ), NULL, this );
	mFontBold->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( FontsetPanel::OnBold ), NULL, this );
	mFontUnderline->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( FontsetPanel::OnUnderline ), NULL, this );
	mFontItalic->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( FontsetPanel::OnItalic ), NULL, this );
	mFontHeight->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnFontHeightChanged ), NULL, this );
	mFontHeight->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnFontHeightChanged ), NULL, this );
	mFontWidth->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnFontWidthChanged ), NULL, this );
	mFontWidth->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnFontWidthChanged ), NULL, this );
	mStartCharacter->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnStartCharacterChanged ), NULL, this );
	mStartCharacter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnStartCharacterChanged ), NULL, this );
	mImageWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( FontsetPanel::OnImageSizeChanged ), NULL, this );
	mImageHeight->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( FontsetPanel::OnImageSizeChanged ), NULL, this );
	mCellHeight->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnCellHeightChanged ), NULL, this );
	mCellHeight->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnCellHeightChanged ), NULL, this );
	mCellWidth->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnCellWidthChanged ), NULL, this );
	mCellWidth->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnCellWidthChanged ), NULL, this );
	mAntiAliasMode->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( FontsetPanel::OnAntiAlias ), NULL, this );
}

FontsetPanel::~FontsetPanel()
{
	// Disconnect Events
	mFontsetName->Disconnect( wxEVT_CHAR, wxKeyEventHandler( FontsetPanel::OnCharFontsetName ), NULL, this );
	mFontsetName->Disconnect( wxEVT_KEY_UP, wxKeyEventHandler( FontsetPanel::OnKeyUpFontsetName ), NULL, this );
	mFontsetName->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( FontsetPanel::OnKillFocusFontsetName ), NULL, this );
	mFontsetName->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( FontsetPanel::OnFontsetNameChanged ), NULL, this );
	mFontName->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( FontsetPanel::OnFontName ), NULL, this );
	mFontBold->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( FontsetPanel::OnBold ), NULL, this );
	mFontUnderline->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( FontsetPanel::OnUnderline ), NULL, this );
	mFontItalic->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( FontsetPanel::OnItalic ), NULL, this );
	mFontHeight->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnFontHeightChanged ), NULL, this );
	mFontHeight->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnFontHeightChanged ), NULL, this );
	mFontWidth->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnFontWidthChanged ), NULL, this );
	mFontWidth->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnFontWidthChanged ), NULL, this );
	mStartCharacter->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnStartCharacterChanged ), NULL, this );
	mStartCharacter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnStartCharacterChanged ), NULL, this );
	mImageWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( FontsetPanel::OnImageSizeChanged ), NULL, this );
	mImageHeight->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( FontsetPanel::OnImageSizeChanged ), NULL, this );
	mCellHeight->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnCellHeightChanged ), NULL, this );
	mCellHeight->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnCellHeightChanged ), NULL, this );
	mCellWidth->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( FontsetPanel::OnCellWidthChanged ), NULL, this );
	mCellWidth->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( FontsetPanel::OnCellWidthChanged ), NULL, this );
	mAntiAliasMode->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( FontsetPanel::OnAntiAlias ), NULL, this );
}

ConfigDlg::ConfigDlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer6;
	bSizer6 = new wxBoxSizer( wxVERTICAL );
	
	m_panel2 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxFlexGridSizer* fgSizer2;
	fgSizer2 = new wxFlexGridSizer( 1, 2, 0, 0 );
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText11 = new wxStaticText( m_panel2, wxID_ANY, wxT("System font directory (eg. c:\\windows\\FONTS)"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText11->Wrap( 250 );
	fgSizer2->Add( m_staticText11, 0, wxALL, 5 );
	
	mConfigFontDir = new wxDirPickerCtrl( m_panel2, ID_CONFIG_FONT_DIR, wxEmptyString, wxT("Select the directory where system fonts are stored"), wxDefaultPosition, wxSize( -1,-1 ), wxDIRP_DEFAULT_STYLE );
	mConfigFontDir->SetMinSize( wxSize( 250,20 ) );
	
	fgSizer2->Add( mConfigFontDir, 0, wxALL|wxEXPAND, 5 );
	
	m_panel2->SetSizer( fgSizer2 );
	m_panel2->Layout();
	fgSizer2->Fit( m_panel2 );
	bSizer6->Add( m_panel2, 1, wxALL|wxEXPAND, 5 );
	
	mConfigConfirmBtn = new wxStdDialogButtonSizer();
	mConfigConfirmBtnOK = new wxButton( this, wxID_OK );
	mConfigConfirmBtn->AddButton( mConfigConfirmBtnOK );
	mConfigConfirmBtnCancel = new wxButton( this, wxID_CANCEL );
	mConfigConfirmBtn->AddButton( mConfigConfirmBtnCancel );
	mConfigConfirmBtn->Realize();
	bSizer6->Add( mConfigConfirmBtn, 0, wxEXPAND, 5 );
	
	this->SetSizer( bSizer6 );
	this->Layout();
	
	// Connect Events
	mConfigConfirmBtnOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlg::OnOK ), NULL, this );
}

ConfigDlg::~ConfigDlg()
{
	// Disconnect Events
	mConfigConfirmBtnOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlg::OnOK ), NULL, this );
}

ProjectSettingsDialog::ProjectSettingsDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText12 = new wxStaticText( this, wxID_ANY, wxT("Author:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText12->Wrap( -1 );
	bSizer7->Add( m_staticText12, 0, wxALL, 5 );
	
	mAuthorName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer7->Add( mAuthorName, 0, wxALL|wxEXPAND, 5 );
	
	m_staticText13 = new wxStaticText( this, wxID_ANY, wxT("Notes:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText13->Wrap( -1 );
	bSizer7->Add( m_staticText13, 0, wxALL, 5 );
	
	mNotes = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,150 ), 0 );
	bSizer7->Add( mNotes, 0, wxALL|wxEXPAND, 5 );
	
	m_staticText14 = new wxStaticText( this, wxID_ANY, wxT("Copyright:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText14->Wrap( -1 );
	bSizer7->Add( m_staticText14, 0, wxALL, 5 );
	
	mCopyright = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,50 ), 0 );
	bSizer7->Add( mCopyright, 0, wxALL|wxEXPAND, 5 );
	
	m_sdbSizer2 = new wxStdDialogButtonSizer();
	m_sdbSizer2OK = new wxButton( this, wxID_OK );
	m_sdbSizer2->AddButton( m_sdbSizer2OK );
	m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL );
	m_sdbSizer2->AddButton( m_sdbSizer2Cancel );
	m_sdbSizer2->Realize();
	bSizer7->Add( m_sdbSizer2, 1, wxEXPAND, 5 );
	
	this->SetSizer( bSizer7 );
	this->Layout();
}

ProjectSettingsDialog::~ProjectSettingsDialog()
{
}
